package com.example.controller;

import com.example.entity.User;
import com.example.mapper.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:0xOO
 * @Date: 2018/9/26 0026
 * @Time: 14:42
 */

@RestController
@RequestMapping("/testBoot")
public class UserController {

    @Autowired
    UserMapper userMapper;

    @RequestMapping("getUser")
    public List<User> GetUser(){
        PageHelper.startPage(1, 2);
        List<User> l  = userMapper.Sel();
        return l;
    }

    @RequestMapping("insert")
    public String insert(){
        PageHelper.startPage(1, 2);
         userMapper.insert(new User(98,"ttt","up"));
        return null;
    }
}
